A template is a blueprint for creating a new entity. A template captures a frequently used pattern, facilitating uniformity and best practice enforcement across entities created using the template. For example, a template may allow a user to quickly generate a new document, file, data structure, web page, and so on, without having to rebuild commonly used elements from scratch. In another example, best practice solution patterns designed by an expert may be captured in templates and reused in projects, aiding in best practice enforcement, and making the expert's knowledge available to multiple projects in the expert's domain of specialization.
The process of creating a new entity using a given template is called template instantiation. Conventional approaches to instantiation include template interpretation approaches that include retrieving a serialized representation of the template, parsing the serialized representation, and traversing the in-memory intermediate representation while calling appropriate high-level system-specific middle-tier APIs to generate the required entities. As a result, template interpretation approaches may incur repeated template retrieval and parsing costs for each instantiation operation because the template is loaded to the middle tier and parsed each time the template is instantiated. Additionally, as the middle tier may make multiple database calls and service calls, multiple round trips and cycles of processing may be required to complete a request. Therefore, memory and processing requirements for template instantiation may be high, and response time may be degraded, due to the number of operations performed by the middle tier when a template is instantiated in the conventional manner.